package com.molyfun.parents.rest.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.molyfun.parents.rest.BaseResponse;

import java.util.List;

/**
 * Created by william(liuchao.hit@gmail.com).
 * Date:11/22/16.
 */
public class MsgListResponse extends BaseResponse {

    private MsgBeanList data;

    public MsgBeanList getData() {
        return data;
    }

    public static class MsgBeanList {

        private int offset;
        private int limit;
        private int total;
        private int size;
        private int pages;
        private int current;
        private boolean searchCount;
        private List<MsgBean> records;
        private boolean asc;
        private int offsetCurrent;

        public int getOffset() {
            return offset;
        }

        public void setOffset(int offset) {
            this.offset = offset;
        }

        public int getLimit() {
            return limit;
        }

        public void setLimit(int limit) {
            this.limit = limit;
        }

        public int getTotal() {
            return total;
        }

        public void setTotal(int total) {
            this.total = total;
        }

        public int getSize() {
            return size;
        }

        public void setSize(int size) {
            this.size = size;
        }

        public int getPages() {
            return pages;
        }

        public void setPages(int pages) {
            this.pages = pages;
        }

        public int getCurrent() {
            return current;
        }

        public void setCurrent(int current) {
            this.current = current;
        }

        public boolean isSearchCount() {
            return searchCount;
        }

        public void setSearchCount(boolean searchCount) {
            this.searchCount = searchCount;
        }

        public List<MsgBean> getRecords() {
            return records;
        }

        public void setRecords(List<MsgBean> records) {
            this.records = records;
        }

        public boolean isAsc() {
            return asc;
        }

        public void setAsc(boolean asc) {
            this.asc = asc;
        }

        public int getOffsetCurrent() {
            return offsetCurrent;
        }

        public void setOffsetCurrent(int offsetCurrent) {
            this.offsetCurrent = offsetCurrent;
        }
    }

    public static class MsgBean implements Parcelable {

        /**
         * id : 936
         * content : 课堂表现：ikmmk同学有了新的课堂表现。点击跳转到详情页面。
         * userid : 8a2d926356a22aaa0156ba75db34028e
         * departid : null
         * departname : null
         * username : ikmmk
         * fromusername : molyfun
         * fromuserid : 8a2d9263540d4e2f01540d779f5c010f
         * createdatetime : 1478517907000
         * code : KTBX
         * isread : 0
         * detailid : 2016-10-14
         */

        private String id;
        private String content;
        private String userid;
        private String departid;
        private String departname;
        private String username;
        private String fromusername;
        private String fromuserid;
        private long createdatetime;
        private String theme;
        private String code;
        private String isread;
        private String detailid;

        //是否选中的标记
        private boolean isChecked = false;

        public boolean isChecked() {
            return isChecked;
        }

        public void setIsChecked(boolean checked) {
            isChecked = checked;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getUserid() {
            return userid;
        }

        public void setUserid(String userid) {
            this.userid = userid;
        }

        public String getDepartid() {
            return departid;
        }

        public void setDepartid(String departid) {
            this.departid = departid;
        }

        public String getDepartname() {
            return departname;
        }

        public void setDepartname(String departname) {
            this.departname = departname;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getFromusername() {
            return fromusername;
        }

        public void setFromusername(String fromusername) {
            this.fromusername = fromusername;
        }

        public String getFromuserid() {
            return fromuserid;
        }

        public void setFromuserid(String fromuserid) {
            this.fromuserid = fromuserid;
        }

        public long getCreatedatetime() {
            return createdatetime;
        }

        public void setCreatedatetime(long createdatetime) {
            this.createdatetime = createdatetime;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getIsread() {
            return isread;
        }

        public void setIsread(String isread) {
            this.isread = isread;
        }

        public String getDetailid() {
            return detailid;
        }

        public void setDetailid(String detailid) {
            this.detailid = detailid;
        }

        public MsgBean() {
        }

        public String getTheme() {
            return theme;
        }

        public void setTheme(String theme) {
            this.theme = theme;
        }


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.content);
            dest.writeString(this.userid);
            dest.writeString(this.departid);
            dest.writeString(this.departname);
            dest.writeString(this.username);
            dest.writeString(this.fromusername);
            dest.writeString(this.fromuserid);
            dest.writeLong(this.createdatetime);
            dest.writeString(this.theme);
            dest.writeString(this.code);
            dest.writeString(this.isread);
            dest.writeString(this.detailid);
            dest.writeByte(this.isChecked ? (byte) 1 : (byte) 0);
        }

        protected MsgBean(Parcel in) {
            this.id = in.readString();
            this.content = in.readString();
            this.userid = in.readString();
            this.departid = in.readString();
            this.departname = in.readString();
            this.username = in.readString();
            this.fromusername = in.readString();
            this.fromuserid = in.readString();
            this.createdatetime = in.readLong();
            this.theme = in.readString();
            this.code = in.readString();
            this.isread = in.readString();
            this.detailid = in.readString();
            this.isChecked = in.readByte() != 0;
        }

        public static final Creator<MsgBean> CREATOR = new Creator<MsgBean>() {
            @Override
            public MsgBean createFromParcel(Parcel source) {
                return new MsgBean(source);
            }

            @Override
            public MsgBean[] newArray(int size) {
                return new MsgBean[size];
            }
        };
    }

}